package com.jdcy.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.jdcy.model.entity.Accounts;
import com.jdcy.model.service.AccountsService;
import com.jdcy.utils.ResultJson;

@RestController
@RequestMapping(value = "account")
public class AccountsController extends BaseController<Accounts> {

	@Autowired
	private AccountsService accountsService;

	@RequestMapping(value = "login", method = RequestMethod.POST)
	public ResultJson login(@RequestBody Accounts accounts) {
		ResultJson json = new ResultJson();
		accounts = accountsService.login(accounts);
		if (accounts != null) {
			json.setMsgcode(200);
			json.setMsginfo("success");
			json.setResult(accounts);
		}
		return json;
	}

}
